{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<PHP>
	function get_handle($id)
	{
		
        $str = l("IPS_VIEW");
        
		$str = "<a href='".u("Ipslog/creditor_view",array("id"=>$id))."'>".$str."</a>";
		
		return $str;
	}
    function get_p_BusiType($bid)
    {
    	if($bid == 1)
        {
        	return "投标";
        }
    }
	function get_reg_type($id)
	{
		return l("P_REG_TYPE_".$id);
	}
    function get_deal_name($deal_id)
    {
    	return M("deal")->where(" id=".$deal_id)->getField("name");
    }
	function get_acct_type($acct_type)
	{
		return l("P_ACCT_TYPE_".$acct_type);
	}
    
    
    function get_p_status($status_id)
	{
		return l("P_CREDITOR_STATUS_".$status_id);
	}
	function get_call_back($back)
	{
		return l("IPS_IS_CALLBACK_".$back);
	}
    function get_user_name_by_id($id)
    {
    	$data_info = M("ips_register_creditor")->getById($id);

    	if($data_info["pAcctType"] == 0)
        {
        	return M("deal_agency")->where(" id=".$data_info["user_id"])->getField("name");
        	
        }
        else if($data_info["pAcctType"] == 1)
        {
    		return M("user")->where(" id=".$data_info["user_id"])->getField("user_name");
        }
        return "";
    }
</php>
<load href='__TMPL__Common/js/jquery.bgiframe.js' />
<load href='__TMPL__Common/js/jquery.weebox.js' />
<load href='__TMPL__Common/style/weebox.css' />
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<div class="main">
<div class="main_title">{%P_CREDITOR_TITLE}</div>
<div class="blank5"></div>
<form name="search" action="__APP__" method="get">	
<div class="button_row">

	<if condition="!$_REQUEST['referer']">
	<input type="button" class="button" value="{%EXPORT}" onclick="m_export_csv('creditor_');" />
	</if>
</div>
<div class="blank5"></div>
<div class="search_row">
		
        {%P_BID_NO}：<input type="text" class="textbox" name="pBidNo" value="{:trim($_REQUEST['pBidNo'])}" style="width:100px;" />
		{%P_MER_CODE}：<input type="text" class="textbox" name="pMerCode" value="{:trim($_REQUEST['pMerCode'])}" style="width:100px;" />
		{%P_MER_BILL_NO}：<input type="text" class="textbox" name="pMerBillNo" value="{:trim($_REQUEST['pMerBillNo'])}" style="width:100px;" />
        {%P_CONTRACT_NO}：<input type="text" class="textbox" name="pContractNo" value="{:trim($_REQUEST['pContractNo'])}" style="width:100px;" />
        
        {%P_ACCOUNT}：<input type="text" class="textbox" name="pAccount" value="{:trim($_REQUEST['pAccount'])}" style="width:100px;" />
        <div class="blank5"></div>
        {%P_ACCOUNT_DEAL_NO}：<input type="text" class="textbox" name="pAccountDealNo" value="{:trim($_REQUEST['pAccountDealNo'])}" style="width:100px;" />
        
        {%P_P2P_BILL_NO}：<input type="text" class="textbox" name="pP2PBillNo" value="{:trim($_REQUEST['pP2PBillNo'])}" style="width:100px;" />
        
        
        {%P_ACCT_TYPE}：<select name="pAcctType">
				<option value="-1" <if condition="intval($_REQUEST['pAcctType']) eq -1 || $_REQUEST['pAcctType'] eq ''">selected="selected"</if>>{%ALL}</option>
				<option value="0" <if condition="$_REQUEST['pAcctType'] neq '' && intval($_REQUEST['pAcctType']) eq 0">selected="selected"</if>>{%P_ACCT_TYPE_0}</option>
				<option value="1" <if condition="intval($_REQUEST['pAcctType']) eq 1">selected="selected"</if>>{%P_ACCT_TYPE_1}</option>			
		</select>
       
        {%P_CREDITOR_STATUS}：<select name="pStatus">
				<option value="-1" <if condition="intval($_REQUEST['pStatus']) eq -1 || $_REQUEST['pStatus'] eq ''">selected="selected"</if>>{%ALL}</option>
				<option value="0" <if condition="$_REQUEST['pStatus'] neq '' && intval($_REQUEST['pStatus']) eq 0">selected="selected"</if>>{%P_CREDITOR_STATUS_0}</option>
				<option value="1" <if condition="intval($_REQUEST['pStatus']) eq 1">selected="selected"</if>>{%P_CREDITOR_STATUS_1}</option>		
                <option value="10" <if condition="intval($_REQUEST['pStatus']) eq 10">selected="selected"</if>>{%P_CREDITOR_STATUS_10}</option>	
		</select>
        
         {%P_REG_TYPE}：<select name="pRegType">
				<option value="-1" <if condition="intval($_REQUEST['pRegType']) eq -1 || $_REQUEST['pRegType'] eq ''">selected="selected"</if>>{%ALL}</option>
				<option value="1" <if condition="intval($_REQUEST['pRegType']) eq 1">selected="selected"</if>>{%P_REG_TYPE_1}</option>		
                <option value="2" <if condition="intval($_REQUEST['pRegType']) eq 2">selected="selected"</if>>{%P_REG_TYPE_2}</option>	
		</select>
        <div class="blank5"></div>
        {%P_REG_DATE}：
		<input type="text" class="textbox" name="start_time" id="start_time" value="{:trim($_REQUEST['start_time'])}" onfocus="return showCalendar('start_time', '%Y-%m-%d', false, false, 'start_time');" />
		-
		<input type="text" class="textbox" name="end_time" id="end_time" value="{:trim($_REQUEST['end_time'])}" onfocus="return showCalendar('end_time', '%Y-%m-%d', false, false, 'end_time');" />
		
		<input type="hidden" value="Ipslog" name="m" />
		<input type="hidden" value="creditor" name="a" />
		<input type="submit" class="button" value="{%SEARCH}" />

</div>
</form>
<div class="blank5"></div>
<html:list 
	id="dataTable" 
	style="dataTable" 
	name="ips_register_creditor" 
	action="true" 
	datasource="list" 
	show="id:{%ID}
         ,deal_id|get_deal_name:{%DEAL_NAME}
    	 ,id|get_user_name_by_id:{%P_USER_NAME}
   		 ,pMerCode:{%P_MER_CODE}
         ,pMerBillNo:{%P_MER_BILL_NO}
         ,pMerDate:{%P_MER_DATE}
         ,pBidNo:{%P_BID_NO}
         ,pContractNo:{%P_CONTRACT_NO}
		 ,pRegType|get_reg_type:{%P_REG_TYPE}
		 ,pAuthNo:{%P_AUTH_NO}
         ,pAuthAmt:{%P_AUTH_AMT}
         ,pTrdAmt:{%P_TRD_AMT}
         ,pFee:{%P_FEE}
         ,pAcctType|get_acct_type:{%P_ACCT_TYPE}
         ,pRealName:{%P_REAL_NAME}
         ,pAccount:{%P_ACCOUNT}
         ,pUse:{%P_USE}
         ,pBusiType|get_p_BusiType:{%P_BUSI_TYPE}
         ,pStatus|get_p_status:{%P_CREDITOR_STATUS}
		 "
	actionlist="id|get_handle" /> 
<div class="blank5"></div>
<div class="page">{$page}</div>
</div>
<include file="Public:footer" />

<!--
		 ,'P_STATUS':{%P_STATUS}
         ,P_BANK_NAME':{%P_BANK_NAME}
         ,'P_BK_ACC_NAME':{%P_BK_ACC_NAME}
         ,'P_BK_ACC_NO':{%P_BK_ACC_NO}
         ,'P_CARD_STATUS':{%P_CARD_STATUS}
         ,'P_PH_STATUS':{%P_PH_STATUS}
         ,'P_IPS_ACCE_NO':{%P_IPS_ACCE_NO}
         ,'P_IPS_ACCE_DATE':{%P_IPS_ACCE_DATE}
         ,'P_MER_CODE':{%P_MER_CODE}
         ,'P_ERR_CODE':{%P_ERR_CODE}
         ,'P_ERR_MSG':{%P_ERR_MSG}
         ,'IS_CALLBACK':{%IS_CALLBACK}
-->